/*
 *  author : Mishal Parmar
 * Date: 21 Oct 2012
 */
package dbhandler;
import entityclasses.eventtype;

import java.sql.*;
import java.util.ArrayList;
/**
 *
 * Author : Mishal Parmar
 * last change : 21-10-2012
 */
public class EventType {
  
public ArrayList eventtype() throws SQLException, ClassNotFoundException         
    {
        String Query;
        
        
        
        Query = "select * from tbl_eventtype;";
        
        
        DBConnection db = new DBConnection();
        ArrayList<eventtype> eventtype=new ArrayList<eventtype>();
        ResultSet rs;
        
         
        
        int ab = 0;
        db.connect();
        try {
            rs=db.customQuery(Query);
            
            
           while(rs.next()){
                eventtype type=new eventtype();
                type.setType_id(Integer.parseInt(rs.getString(1)));
                type.setEvent_type(rs.getString(2));
                
                eventtype.add(type);
                
                
            }
            
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        db.disconnect();
        
        
        return eventtype;
    }
public static void main(String [] args) throws SQLException, ClassNotFoundException{
    
    
}
    
}    

